const express = require("express");

const route = express.Router();

const AdminModule = require("../mongoose/module/index");
//权限验证
const isLogin = require("../verify/isLogin");

//解析请求体
route.use(express.json());
route.use(express.urlencoded());

route.get("/adminList", isLogin, async (request, response) => {
  //请求之后查询数据库

  let result = await AdminModule.find({});
  response.send({
    code: 200,
    message: "查询成功",
    data: result,
  });
});

module.exports = route;
